package com.qxp.simplerpc;

import com.qxp.simplerpc.annotation.EnableSimpleRpcAutoConfig;
import com.qxp.simplerpc.config.ServerConfig;
import com.qxp.simplerpc.utils.SimpleRpcProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@ConditionalOnBean(annotation= EnableSimpleRpcAutoConfig.class)
@EnableConfigurationProperties
@Import(SimpleRpcProperties.class)
public class AutoConfiguration {
    @Bean
    public ServerConfig getServerConfig(){
        return new ServerConfig();
    }

}
